#include <gperftools/profiler.h>
#include<iostream>

void function_1() {
    long long sum = 0;
    for (int i = 0; i < 10000000; ++i) {
        sum += i;
    }
}

void function_2() {
    long long sum = 0;
    for (int i = 0; i < 10000000; ++i) {
        sum -= i;
    }
}

int main() {
    ProfilerStart("example.prof");

    function_1();
    function_2();

    ProfilerStop();
    std::cout << "Profiler stopped."<< std::endl;

    return 0;
}